package org.example.day20240813;

import java.util.Arrays;
import java.util.Scanner;

public class test4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String arr1 = scanner.nextLine();
        String arr2 = scanner.nextLine();
        int x,y;
        char[] Arr2 = arr2.toCharArray();
        for(int i=0; i<Arr2.length; i++){
            for(int j=0; j<Arr2.length; j++){
                if(((Arr2[i]-'0')-(Arr2[j]-'0') == 1 || ((Arr2[i]-'0')-(Arr2[j]-'0') == -1 ))){
                    System.out.print(Arr2[i]);
                    System.out.print(Arr2[j]+" ");
                }
            }
        }

    }

}
